;(function (window, document) {
  // 设计图尺寸
  var designWidth = 750
  var html = document.getElementsByTagName('html').item(0)
  // if (window.innerWidth < designWidth) {
  //     html.style.fontSize = parseInt(window.innerWidth / designWidth * 100, 10) + 'px';
  // }

  // 窗口尺寸变化事件
  var resize = (function resize() {
    var windoWidth = window.innerWidth;
    var viewScale = windoWidth < designWidth ? (windoWidth / designWidth) : 1
    html.style.fontSize = parseInt(viewScale * 100, 10) + 'px'
    // 全局变量 0~1
    window.rem_scale = viewScale
    return resize
  })()

  function standard_browser () {
    var ev = document.createEvent("HTMLEvents")
    ev.initEvent("resize", false, true)
    window.dispatchEvent(ev)
  }

  // 添加事件
  window.addEventListener('resize', resize)
  standard_browser();

  // window加载完毕触发事件
  window.addEventListener('load', standard_browser)

})(window, document)

// <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1, minimum-scale=1">
// 想效果好 再给html body 设个 max-width="750px" margin:0 auto
